package bairui.international.model.domain.jpa;

/**
 *
 * @see TB_IndexModuleImg 首页模块图片视频
 *
 */
public class TestData_TB_IndexModuleImg
{

	private final static org.apache.commons.text.RandomStringGenerator Generator = new org.apache.commons.text.RandomStringGenerator.Builder().withinRange(new char[][]{{'a','z'}, {'A','Z'}, {'0','9'}}).build();

	@SuppressWarnings({ "unchecked", "rawtypes" })
	@org.springframework.transaction.annotation.Transactional(rollbackFor=java.lang.Throwable.class)
	public static TB_IndexModuleImg saveMust(
		org.springframework.context.ApplicationContext context,
		bairui.international.model.domain.jpa.TB_IndexModule indexModule
	){
		org.springframework.data.jpa.repository.JpaRepository repository = (org.springframework.data.jpa.repository.JpaRepository)context.getBean("repository_IndexModuleImg");
		return (TB_IndexModuleImg)repository.save(newMust(
				indexModule
			));
	}
	
	public static TB_IndexModuleImg newMust(
		bairui.international.model.domain.jpa.TB_IndexModule indexModule
	){
		return new TB_IndexModuleImg(new TB_IndexModuleImg.MustProperties() {
			/** 名称 */
			@Override public String getName(){
				return Generator.generate(0, 100);
			}
			/** 文档 */
			@Override public String getFileUrl(){
				return Generator.generate(0, 100);
			}
			/** 类型 */
			@Override public String getType(){
				return Generator.generate(0, 8);
			}
			/** 原名称 */
			@Override public String getOriginalName(){
				return Generator.generate(0, 100);
			}
			/** 大小 */
			@Override public Double getSize(){
				return com.sh_lianjing.test.random.Util_GenerateRandom.doubleRandom(0, Long.MAX_VALUE);
			}
			/** 首页模块 */
			@Override public bairui.international.model.domain.jpa.TB_IndexModule getIndexModule(){
				return indexModule;
			}
			/** 状态 */
			@Override public com.sh_lianjing.model.status.State_UpDown getState(){
				return com.sh_lianjing.model.status.State_UpDown.Downed;
			}
			/** 格式 */
			@Override public bairui.international.model.type.Type_IndexModuleImg getFormat(){
				return bairui.international.model.type.Type_IndexModuleImg.Img;
			}
		});
	}
	

	@SuppressWarnings({ "unchecked", "rawtypes" })
	@org.springframework.transaction.annotation.Transactional(rollbackFor=java.lang.Throwable.class)
	public static TB_IndexModuleImg saveAll(
		org.springframework.context.ApplicationContext context,
		bairui.international.model.domain.jpa.TB_IndexModule indexModule
	){
		org.springframework.data.jpa.repository.JpaRepository repository = (org.springframework.data.jpa.repository.JpaRepository)context.getBean("repository_IndexModuleImg");
		return (TB_IndexModuleImg)repository.save(newAll(
				indexModule
			));
	}
	
	public static TB_IndexModuleImg newAll(
		bairui.international.model.domain.jpa.TB_IndexModule indexModule
	){
		return new TB_IndexModuleImg(
			new TB_IndexModuleImg.MustProperties() {
				/** 名称 */
				@Override public String getName(){
					return Generator.generate(0, 100);
				}
				/** 文档 */
				@Override public String getFileUrl(){
					return Generator.generate(0, 100);
				}
				/** 类型 */
				@Override public String getType(){
					return Generator.generate(0, 8);
				}
				/** 原名称 */
				@Override public String getOriginalName(){
					return Generator.generate(0, 100);
				}
				/** 大小 */
				@Override public Double getSize(){
					return com.sh_lianjing.test.random.Util_GenerateRandom.doubleRandom(0, Long.MAX_VALUE);
				}
				/** 首页模块 */
				@Override public bairui.international.model.domain.jpa.TB_IndexModule getIndexModule(){
					return indexModule;
				}
				/** 状态 */
				@Override public com.sh_lianjing.model.status.State_UpDown getState(){
					return com.sh_lianjing.model.status.State_UpDown.Downed;
				}
				/** 格式 */
				@Override public bairui.international.model.type.Type_IndexModuleImg getFormat(){
					return bairui.international.model.type.Type_IndexModuleImg.Img;
				}
			},
			new TB_IndexModuleImg.OptionalSingleProperties() {
				/** Url */
				@Override public String getUrl(){
					return Generator.generate(0, 255);
				}
			}
		);
	}
	

}
